package org.example.myalgorithm.ch1;

import org.springframework.stereotype.Service;

@Service
public class Solution {
    public void PrintDigit(int n){
        System.out.print(n%10);
        if (n>=10) PrintDigit(n/10);
    }

    public void Perm(int[] a,int k,int n){
        if(k==n-1){
            for (int i:a){
                System.out.print(i+" ");
            }
            System.out.println();
        }
        for(int i=k;i<n;i++){
            int t = a[k];a[k] = a[i];a[i] = t;
            Perm(a,k+1,n);
            t = a[k];a[k] = a[i];a[i] = t;
        }
    }
}
